<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function DatileAction(thema_num) {
		themaListFrom.thema_num.value=thema_num;
		themaListFrom.submit();
	}
	
</script>
</head>
<body>
<form action="/food/thema/themaDatile" name="themaListFrom" >
<input type="hidden" name="thema_num" value="">
<input type="hidden" name="startPage" value="${themaDto.startPage}">		
<input type="hidden" name="endPage" value="${themaDto.endPage}">		
<input type="hidden" name="maxPage" value="${themaDto.maxPage}">		
<input type="hidden" name="nowPage" value="${themaDto.nowPage}">
<input type="hidden" name="thema_ailgn" value="${themaDto.thema_ailgn}">
<input type="hidden" name="thema_ailgn" value="${themaDto.thema_type}">
<table>
	<tr>
		<td colspan="10"><h1>ThemaList</h1></td>
	</tr>
	<tr>
		<td>구분</td>
		<td>
			<a href="/food/thema/themaSelectList?thema_type=1">데이트</a>
			<a href="/food/thema/themaSelectList?thema_type=2">상견례</a>
			<a href="/food/thema/themaSelectList?thema_type=3">회식</a>
		</td>
	</tr>
	<tr>
		<td>정렬</td>
		<td>
			<a href="/food/thema/themaSelectList?thema_ailgn=thema_date&thema_type=${themaDto.thema_type}">날짜순</a>
			<a href="/food/thema/themaSelectList?thema_ailgn=thema_score&thema_type=${themaDto.thema_type}">점수</a>
			<a href="/food/thema/themaSelectList?thema_ailgn=thema_readcnt&thema_type=${themaDto.thema_type}">조회순</a>
		</td>
	</tr>
</table>
<table border="1">

	<tr>
		<td>번호</td>
		<td>테마구분</td>
		<td>음식구분</td>
		<td>지역</td>
		<td>이미지</td>
		<td>제목</td>
		<td>등록일</td>
		<td>조회수</td>
		<td>평점</td>
	</tr>
	<c:forEach items="${themaDtoList}" var="themaDto">
	<tr>
		<td>${themaDto.thema_num}</td>
		<td>
		<c:choose>
			<c:when test="${themaDto.thema_type==1}">데이트</c:when>
			<c:when test="${themaDto.thema_type==2}">상견례</c:when>
			<c:when test="${themaDto.thema_type==3}">회식</c:when>
		</c:choose>		
		</td>
		<td>${themaDto.thema_category1} ${themaDto.thema_category2}</td>
		<td>${themaDto.thema_area1} ${themaDto.thema_area2}</td>
		<td><img src="/food/resources/thema/${themaDto.thema_image}" width="200" height="200"></td>
		<td>${themaDto.thema_subject }</td>
		<td>${themaDto.thema_date }</td>
		<td>${themaDto.thema_readcnt }</td>
		<td>${themaDto.thema_score/themaDto.thema_participant}</td>
		<td><input type="button" value="이동" onclick="DatileAction(${themaDto.thema_num})"></td>
	</tr>	
	</c:forEach>
	<tr>
		<td colspan="10">	

			<c:forEach begin="${themaDto.startPage}" end="${themaDto.endPage}" var="count">
				<c:if test="${themaDto.nowPage==count}">
					${count}&nbsp;&nbsp;
				</c:if>
				<c:if test="${themaDto.nowPage!=count}">
					<a href="/food/thema/themaSelectList?nowPage=${count}">${count}</a>&nbsp;&nbsp;
				</c:if>
			</c:forEach>
					
		</td>
	</tr>
	<tr>
		<td colspan="7"></td>
		<td><a href="/food/thema/page">글쓰기</a></td>	
	</tr>
	
</table>
</form>
</body>
</html>